package com.my12306.train.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.my12306.common.util.PageUtils;
import com.my12306.common.util.response.ResponseData;
import com.my12306.train.model.entity.SeatEntity;
import com.my12306.train.model.vo.PageSeatVo;

import java.util.Date;
import java.util.List;

/**
 * 席位信息表
 *
 * @author ËÕÄÁÏ¦
 * @email
 * @date 2020-07-24 20:58:07
 */
public interface SeatService extends IService<SeatEntity> {

    /**
     * 每天刷新席位表
     */
    void refreshSeatEveryDay();

    /**
     * 批量删除
     *
     * @param seatIds
     */
    ResponseData removeSeatByIds(List<Long> seatIds);

    /**
     * 修改
     *
     * @param seat
     */
    ResponseData updateSeatById(SeatEntity seat);

    /**
     * 保存
     *
     * @param seat
     * @return
     */
    ResponseData saveSeat(SeatEntity seat);

    /**
     * 批量添加一个车次的所有票据
     * @param seatEntities
     * @return
     */
    Boolean saveBatchSeat(List<List<SeatEntity>> seatEntities);

    /**
     * 查询席位信息
     *
     * @param seatId
     * @return
     */
    SeatEntity getSeatById(Long seatId);

    /**
     * 分页查询
     *
     * @param pageVo
     * @return
     */
    PageUtils querySeatsByPage(PageSeatVo pageVo);

    /**
     * 判断是否已经生成过席位信息
     * @param trainCode
     * @return
     */
    List<SeatEntity> querySeatsByTrainCode(String trainCode);

    /**
     * 查询所有可预售的时间
     * @return
     */
    List<Date> queryAllSeatsDate();

    /**
     * 根据时间查询车票
     * @param startDate
     * @param trainCode
     * @param sold
     * @param logicDelete
     * @return
     */
    List<SeatEntity> querySeateByStartDate(String startDate, String trainCode, Integer sold,Integer logicDelete);

    /**
     * 根据发车时间和销售状态和车次id和起始站查询 席位信息
     * @param strDate
     * @param trainCode
     * @param seateNotSold
     * @param fromStation
     * @param logicDelete
     * @return
     */
    List<SeatEntity> querySeateByStartDateAndTrainCode(String strDate, List<String> trainCode, Integer seateNotSold,String fromStation, Integer logicDelete);

    List<SeatEntity> queryTicketSeateByStartDateAndTrainCode(String strDate, List<String> trainCode, Integer seateNotSold,String fromStation, Integer logicDelete);



    /**
     * 根据车次代码和车厢编号删除席位信息
     * @param trainCodes
     * @param coachNumbers
     * @param logicDelete
     */
    void deleteBatchSeatsByTrainCodeAndCoachNumber(List<String> trainCodes,List<Long> coachNumbers,int logicDelete,int showStatus);

    void updateBatchSeats(List<List<SeatEntity>> seatEntities);

    /**
     * 根据车站名称和时间和车次代码 检索已经售票但不影响当前用户的出发点站购票
     * @param strDate
     * @param trainCodes
     * @param stations
     * @param seateSold
     * @param logicDelete
     * @return
     */
    List<SeatEntity> querySeateSoledByTrainCodeAndStations(String strDate, String trainCodes, List<String> stations, Integer seateSold, Integer logicDelete);

    List<SeatEntity> queryTicketSeate(String strDate, String trainCode, List<String> stations, Integer seateSold, Integer logicDelete);

}

